﻿using System;
using System.Collections.Generic;
using System.Text;

namespace lyAdmin.Domain.Common
{
    public class ResultUtil
    {
        /// <summary>
        /// 返回失败
        /// </summary> 
        public static ServiceResult Fail(string msg,object data)
        {
            return new ServiceResult() { Msg = msg, Data = data, State = false };
        }
        /// <summary>
        /// 返回失败
        /// </summary> 
        public static ServiceResult Fail(string msg)
        {
            return new ServiceResult() { Msg = msg, State = false };
        }
        /// <summary>
        /// 返回成功
        /// </summary> 
        public static ServiceResult Success(string msg, object data)
        {
            return new ServiceResult() { Msg = msg, Data = data, State = true };
        }
        /// <summary>
        /// 返回成功
        /// </summary> 
        public static ServiceResult Success()
        {
            return new ServiceResult() { Msg = "操作成功" };
        }
        /// <summary>
        /// 返回成功
        /// </summary> 
        public static ServiceResult Success(object data)
        {
            return new ServiceResult() { Msg = "操作成功", Data = data, State = true };
        }
        /// <summary>
        /// 返回成功
        /// </summary> 
        public static ServiceResult Success(string msg)
        {
            return new ServiceResult() { Msg = msg, State = true };
        }
    }
}
